/**
 * @author Victor.Wang
 */

package chinachess.mid;

import chinachess.mid.MID_ChessBoard.PiecePosition;


/**
 * @author Administrator
 *
 */
class MID_Piece implements MID_IPiece {
	
	private PieceColor color;
	private PieceType type;
	private PiecePosition position;
	private PieceStatus status;
	
	public MID_Piece(PieceColor color, PieceType type){
		this.color = color;
		this.type = type;
		this.status = PieceStatus.LIVE;
		this.position = new PiecePosition();
	}
	
	public MID_Piece(PieceColor color, PieceType type, PiecePosition position){
		this(color,type);
		this.position = position;
	}

	/* (non-Javadoc)
	 * @see com.magicw.games.chinachess.mid.pieces.MID_IPiece#getPieceColor()
	 */
	@Override
	public PieceColor getPieceColor() {
		// TODO Auto-generated method stub
		return this.color;
	}

	/* (non-Javadoc)
	 * @see com.magicw.games.chinachess.mid.pieces.MID_IPiece#getPiecePosition()
	 */
	@Override
	public PiecePosition getPiecePosition() {
		// TODO Auto-generated method stub
		return this.position;
	}

	/* (non-Javadoc)
	 * @see com.magicw.games.chinachess.mid.pieces.MID_IPiece#getPieceStatus()
	 */
	@Override
	public PieceStatus getPieceStatus() {
		// TODO Auto-generated method stub
		return this.status;
	}

	/* (non-Javadoc)
	 * @see com.magicw.games.chinachess.mid.pieces.MID_IPiece#getPieceType()
	 */
	@Override
	public PieceType getPieceType() {
		// TODO Auto-generated method stub
		return this.type;
	}

	/* (non-Javadoc)
	 * @see com.magicw.games.chinachess.mid.pieces.MID_IPiece#isValidMove(com.magicw.games.chinachess.mid.MID_ChessBoard.PiecePosition)
	 */
	@Override
	public boolean isValidMove(PiecePosition toPosition) {
		// TODO Auto-generated method stub
		return false;
	}
	
	public boolean setPieceStatus(PieceStatus status){
		this.status = status;
		return true;
	}
	
	void setPieceColor(PieceColor color){
		this.color = color;
	}
	
	void setPieceType(PieceType type){
		this.type = type;
	}
	
	boolean setPiecePosition(PiecePosition position){
		this.position.x = position.x;
		this.position.y = position.y;
		return true;
	}
	
	boolean setPiecePosition(int col, int row){
		this.position.x = col;
		this.position.y = row;
		
		return true;
	}
}
